﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Data;
using DTO;
using DAL;

namespace BLL
{
    public class CommonBLL
    {
        #region Khai báo
        private CommonDAL _cmDAL;
        #endregion

        #region Khởi tạo
        public CommonBLL()
        {
            _cmDAL = new CommonDAL();
        }
        #endregion

        #region Lấy các giá trị quy định trong bảng tham số
        public int laySoLuotMuaGoiLaHot()
        {
            try
            {
                return _cmDAL.laySoLuotMuaGoiLaHot();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion

        #region laySoSanPhamTrenTrang
        public int laySoSanPhamTrenTrang()
        {
            try
            {
                return _cmDAL.laySoSanPhamTrenTrang();
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
        #endregion

        #region Phương thức getDataSet
        // <summary>
        /// Phương thức getDataSet
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns>DataSet</returns>
        public DataSet getDataSet(string tableName)
        {
            DataSet ds = new DataSet();
            try
            {
                ds = _cmDAL.getDataSet(tableName);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return ds;
        }
        #endregion

       
    }
}